import unittest
from HTMLTestRunner import HTMLTestRunner
import time
# 组装测试套件
suite = unittest.defaultTestLoader.discover("../scripts", pattern="*.py")

# 测试报告存放路径
file_path = "../report/{}.html".format(time.strftime("%Y-%m-%d %H-%M-%S"))

# 运行测试套件并生成测试报告
with open(file_path, "wb")as f:
    HTMLTestRunner(stream=f, verbosity=2, title="计算器", description="在线计算器UI测试").run(suite)
